<template>
  <div class="public-global-nav">
    <div class="public-global-title">
      <div class="public-global-title-text" :title="dataTitle">{{ dataTitle || '默认标题' }}</div>
    </div>

    <a onclick="history.go(-1)">
      <div class="public-global-btn">
        <img
          class="public-global-btn--exit"
          src="//cdnver.13jy.cn/v1/public-global/images/exit.png"
          alt=""
        />
        <div class="public-global-btn-text">退出</div>
      </div>
    </a>
  </div>
</template>

<script lang="ts" setup name="YsHead">
defineProps<{
  dataTitle?: string
}>()
</script>

<style scoped lang="scss">
.public-global-nav {
  position: sticky;
  top: 0;
  z-index: 1;
}

.public-global-title {
  width: calc(100vw - 15rem);

  .public-global-title-text {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
}

.public-global-btn {
  &:active {
    transform: scale(0.96);
  }
}
</style>
